Skip to content

Z-Wave Lock: Report a refused Schlage PIN as a duplicate - #3364

Closed
ctowns wants to merge 1 commit into
mainfrom
zwave-lock/schlage-duplicate-pin
Closed

ctowns wants to merge 1 commit into
mainfrom
zwave-lock/schlage-duplicate-pin

Conversation

@ctowns

@ctowns ctowns commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Schlage locks refuse a PIN that is already in use by answering the UserCode Set with STATUS_NOT_AVAILABLE and a code of zeros, and send no notification. The driver counted that report as a set slot, so addCredential returned success and created a user whose PIN is not on the lock, and updateCredential returned success while the old PIN stayed in place.

While an add or update is waiting, a STATUS_NOT_AVAILABLE report for that slot now returns duplicate, leaves users and credentials unchanged, and clears the busy state. The legacy (lockCodes) Schlage handler is unchanged.

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

Schlage locks refuse a PIN that is already in use by answering the
UserCode Set with STATUS_NOT_AVAILABLE and a code of zeros, and send no
notification. The driver counted that report as a set slot, so
addCredential returned success and created a user whose PIN is not on
the lock, and updateCredential returned success while the old PIN stayed
in place.

While an add or update is waiting, a STATUS_NOT_AVAILABLE report for
that slot now returns duplicate, leaves users and credentials unchanged,
and clears the busy state. The legacy (lockCodes) Schlage handler is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Channel deleted.

@github-actions

Copy link
Copy Markdown

zwave-lock_coverage.xml

File Coverage
All files 91% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/schlage-lock/init.lua 95% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/zwave-alarm-v1-lock/init.lua 43% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/keywe-lock/init.lua 77% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/init.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lazy_load_subdriver.lua 57% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/schlage-lock/init.lua 72% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/zwave-alarm-v1-lock/init.lua 89% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/keywe-lock/can_handle.lua 87% ❌
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/legacy-handlers/samsung-lock/init.lua 94% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_utils/tables.lua 98% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_utils/utils.lua 96% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_handlers/capabilities.lua 96% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/lock_handlers/zwave_responses.lua 91% ✅
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/zwave-lock/src/samsung-lock/can_handle.lua 75% ❌

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against d797c72

@github-actions

Copy link
Copy Markdown

Test Results

   73 files    571 suites   0s ⏱️
3 442 tests 3 442 ✅ 0 💤 0 ❌
5 476 runs  5 476 ✅ 0 💤 0 ❌

Results for commit d797c72.

@ctowns

ctowns commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

These changes have been merged as a part of #3373

@ctowns ctowns closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant